package com.jcfk.eam.api;

import com.jcfk.common.web.domain.RetResult;
import com.jcfk.eam.api.dto.SysUserWithRoleIdDTO;
import com.jcfk.eam.domain.message.WeChatSendRequest;
import com.jcfk.eam.domain.message.WeChatSendSecretRequest;
import com.jcfk.system.domain.dto.SysOrganizationDTO;
import com.jcfk.system.domain.dto.SysUserDTO;
import com.jcfk.system.domain.query.SysOrganizationQuery;
import com.jcfk.system.domain.query.SysUserQuery;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@Component
@FeignClient(name = "system", contextId = "SysServiceFeign", url = "${openfeign.system-service-url:}")
public interface SysServiceFeign {
    // 获取详情
    @PostMapping(value = "/sysOrganization/getList", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    RetResult<List<SysOrganizationDTO>> getOrganizationList(SysOrganizationQuery query);

    @PostMapping(value = "/sysUser/getList", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    RetResult<List<SysUserDTO>> getUserList(SysUserQuery query);

    @PostMapping(value = "/wx/sendMessageChat", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    RetResult<?> sendMessageChat(WeChatSendRequest weChatSendRequest);

    @PostMapping(value = "/wx/sendMessageSecretChat", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    RetResult<?> sendMessageSecretChat(WeChatSendSecretRequest weChatSendSecretRequest);
    // 根据角色id获取用户列表
    @PostMapping(value = "/sysUser/getUserListByRoleIds", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    RetResult<List<SysUserWithRoleIdDTO>> getUserListByRoleIds(List<String> roleIds);
}
